<script>
function OnSubmitForm()
{
  if(document.pressed == 'Cancelar')
  {
    
   document.confirmaform.action ="agregar"; 
  }
  else
  if(document.pressed == 'Guardar')
  {
    document.confirmaform.action ="guardar";
  }
  return true;
}
</script>
<div class="masters view">

    
<h2 style="text-align:center;"><?php  __('Verifique los datos antes de guardar..');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
	
		<div style=" margin-left:0px; width: 960px;  ">
		
		<div>
		<table style="border: none; border-top: none;">
		<tr>
		<td style="border: none;">
		<div style="padding-left:10px; padding-top:5px; width: 400px;">
		<fieldset style="padding-bottom: 30px;">
            <legend><?php __('Datos del Vehiculo'); ?></legend>
			
                <dt<?php if ($i % 2 == 0) echo $class;?>> <?php __('Fecha');  ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
				
			
			
				<?php $fecha = date("d-m-Y",strtotime($date));?>
         	<?php echo $fecha; ?>
					</dd>
					
					
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Tipo'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $vehicles_type['0']['VehiclesType']['descripcion']; ?>
		</dd>
		
		
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Marca'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $brands['0']['Brand']['descripcion']; ?>
		</dd>
		
		
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Modelo'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $models['0']['Model']['descripcion']; ?>
		</dd>
		
		
		
        <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Dominio Extranjero'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo($dom_extran == '0' ) ? 'No' : 'Si';  ?>
		</dd>
		
		

		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Dominio Completo'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
			<?php switch ($dom_compl) {
                                case 0:
                                    echo "No";
                                    break;
                                case 1:
                                    echo "Si";
                                    break;
                                case 2:
                                    echo "Ilegible";
                                    break;
                                case 3:
                                    echo "No Posee";
                                    break;
                                 } ?>
			&nbsp;
		</dd>
		
		
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Dominio'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
			<?php echo $dominio; ?>
			&nbsp;
		</dd>
		
		
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('N° de Motor Completo'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
			<?php switch ($motor_compl) {
                                case 0:
                                    echo "No";
                                    break;
                                case 1:
                                    echo "Si";
                                    break;
                                case 2:
                                    echo "Ilegible";
                                    break;
                                case 3:
                                    echo "No Posee";
                                    break;
                                 }?>
			&nbsp;
		</dd>
		
		
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('N° Motor'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
			<?php echo $nro_motor; ?>
			&nbsp;
		</dd>
			
			
               <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('N° de Chasis Completo'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
			<?php switch ($chasis_compl) {
                                case 0:
                                    echo "No";
                                    break;
                                case 1:
                                    echo "Si";
                                    break;
                                case 2:
                                    echo "Ilegible";
                                    break;
                                case 3:
                                    echo "No Posee";
                                    break;
                                 }?>
			&nbsp;
		</dd>
		
			
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Nº Chasis'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $chasis; ?>
		</dd>
		
		</fieldset>
		</div>
		
		</td>
		
		<td style="border: none;">
		<div style="width: 400px; padding-top:5px; padding-left: 5px;">
		<fieldset style="padding-bottom: 20px;">
		<table>
            <legend><?php __('Datos Judiciales'); ?></legend>
		
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Jurisdicción'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
			<?php echo $jurisdictions['0']['Jurisdiction']['descripcion'] ?>
		</dd> 
		
                <?php if(!empty($provinces['0']['Province']['descripcion'])){?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Provincia'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $provinces['0']['Province']['descripcion'] ?>
		</dd>
		
                <?php }?>
		
		
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Dpto Judicial o <br /> Circunscripción'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $placements['0']['Placement']['descripcion'] ?>
		</dd>
		
                <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Fuero'); ?></dt>
                 <dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $charters['0']['Charter']['descripcion']; ?>
		</dd>
		
               
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Juzgado'); ?></dt>
                <dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
				
		
		
			<?php echo $courts['0']['Court']['descripcion']; ?>
		</dd>
		
		
                 <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Secretaría'); ?></dt>
                 <dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $secretaries['0']['Secretary']['descripcion']; ?>
		</dd>
		
                 <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Causa'); ?></dt>
                 <dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			
                    <?php echo $causes; ?>
		</dd>   
		
		
                 <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Descripción'); ?></dt>
                 <dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $desc_cause; ?>
		</dd> 
		
		</table>
		</fieldset>
		</div>
		</td>
		
		</tr>
		
		
		
		</div>
		
		
		<tr>
		<td style="border: none;">
		
		<div style="padding-left:10px; padding-top:5px; width: 400px;">
		<fieldset style="padding-bottom: 10px;">
<legend><?php __('Fotos'); ?></legend>
<div class="perfil">
                    <?php 
                    echo $html->image('fotos/'.$p_derecho,
                                array('alt' =>'perfil derecho',
                                     'title' => 'perfil derecho',
                                      'width'=>'120',
                                       'height'=>'100')
                                );?>
<div class="perfil_pie">Perfil Derecho</div>
</div>
<div class="perfil">
                    <?php
                    echo $html->image('fotos/'.$p_izquierdo,
                                array('alt' =>'perfil izquierdo',
                                     'title' => 'perfil izquierdo',
                                      'width'=>'120',
                                       'height'=>'100')
                                );?>
<div class="perfil_pie">Perfil Izquierdo</div>
</div>
<div class="perfil">                    
                    <?php
                     echo $html->image('fotos/'.$p_frente,
                                array('alt' =>'frente',
                                     'title' => 'frente',
                                      'width'=>'120',
                                       'height'=>'100')
                                );
                     ?>
<div class="perfil_pie">Frente</div>
</div>
<div class="perfil">  
                     <?php
                     echo $html->image('fotos/'.$p_baul,
                                array('alt' =>'baul',
                                     'title' => 'baul',
                                      'width'=>'120',
                                       'height'=>'100')
                                );?>
<div class="perfil_pie">Baul</div>
</div>
<div class="perfil"> 
                    <?php
                    echo $html->image('fotos/'.$p_interior,
                                array('alt' =>'interior',
                                     'title' => 'interior',
                                      'width'=>'120',
                                       'height'=>'100')
                                );?>
<div class="perfil_pie">Interior</div>
</div>
<div class="perfil">  
                    <?php
                    echo $html->image('fotos/'.$p_motor,
                                array('alt' =>'motor',
                                     'title' => 'motor',
                                      'width'=>'120',
                                       'height'=>'100')
                                );
                    ?>	
<div class="perfil_pie">Motor</div>
</div>
		
		</fieldset>
		</div>
		
		
		</td>
		
		
		<td rowspan="2" style="border: none;">
		
		
		<div style="width: 400px; padding-top:5px; padding-left: 5px;">
		<fieldset style="padding-bottom: 40px;">
            <legend><?php __('Ubicación y Estado'); ?></legend>
		
		
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Estado'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $states['0']['PoliceState']['descripcion']; ?>
		</dd>
		
		
 		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Depósito'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $desposits['0']['Desposit']['descripcion']; ?>
		</dd>               
		
		
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Observaciones'); ?></dt>
		<dd style="padding-left:40px;"<?php if ($i++ % 2 == 0) echo $class;?>>
		
		
			<?php echo $observaciones; ?>
		</dd>
		
		
		</fieldset>
                    <?php
                    echo $this->Form->create('Master',array('onsubmit'=>'return OnSubmitForm();','name'=>'confirmaform'));
                    echo  $this->Form->hidden( 'Flag.name', array( 'value' => '1') );
                    echo  $this->Form->hidden( 'Master.date', array( 'value' => $date ) );
                    echo  $this->Form->hidden( 'Master.jurisdictions_id', array( 'value' => $jurisdictions['0']['Jurisdiction']['id'] ) );
                    echo  $this->Form->hidden( 'Master.provinces_id', array( 'value' => $provinces['0']['Province']['id'] ) );
                    echo  $this->Form->hidden( 'Master.charters_id', array( 'value' => $charters['0']['Charter']['id'] ) );
                    echo  $this->Form->hidden( 'Master.placements_id', array( 'value' => $placements['0']['Placement']['id'] ) );
                    echo  $this->Form->hidden( 'Master.courts_id', array( 'value' => $courts['0']['Court']['id'] ) );
                    echo  $this->Form->hidden( 'Master.police_states_id', array( 'value' => $states['0']['PoliceState']['id'] ) );
                    echo  $this->Form->hidden( 'Master.desposits_id', array( 'value' => $desposits['0']['Desposit']['id'] ) );
                    echo  $this->Form->hidden( 'Master.observaciones', array( 'value' => $observaciones ) );
                    
                    echo  $this->Form->hidden( 'Vehicles.vehicles_types_id', array( 'value' => $vehicles_type['0']['VehiclesType']['id'] ) );
                    echo  $this->Form->hidden( 'Vehicles.models_id', array( 'value' => $models['0']['Model']['id'] ) );
                    echo  $this->Form->hidden( 'Vehicles.extranjero', array( 'value' => $dom_extran ) );
                    echo  $this->Form->hidden( 'Vehicles.dom_parcial', array( 'value' => $dom_compl ) );
                    echo  $this->Form->hidden( 'Vehicles.dominio', array( 'value' => $dominio ) );
                    echo  $this->Form->hidden( 'Vehicles.motor_parc', array( 'value' => $motor_compl ) );
                    echo  $this->Form->hidden( 'Vehicles.chasis_parc', array( 'value' => $chasis_compl ) );
                    echo  $this->Form->hidden( 'Vehicles.nro_motor', array( 'value' => $nro_motor ) );
                    echo  $this->Form->hidden( 'Vehicles.nro_chasis', array( 'value' => $chasis ) );
                    
                    echo  $this->Form->hidden( 'Models.brands_id', array( 'value' => $brands['0']['Brand']['id'] ) );
                    
                    echo  $this->Form->hidden( 'Causes.secretaries_id', array( 'value' => $secretaries['0']['Secretary']['id'] ) );
                    echo  $this->Form->hidden( 'Causes.nro_causa', array( 'value' => $causes ) );
                    echo  $this->Form->hidden( 'Causes.descripcion', array( 'value' => $desc_cause) );
                    echo  $this->Form->hidden( 'uploads.perfil_derecho', array( 'value' => $p_derecho) );
                    echo  $this->Form->hidden( 'uploads.perfil_izquierdo', array( 'value' => $p_izquierdo) );
                    echo  $this->Form->hidden( 'uploads.frente', array( 'value' => $p_frente) );
                    echo  $this->Form->hidden( 'uploads.baul', array( 'value' => $p_baul) );
                    echo  $this->Form->hidden( 'uploads.interior', array( 'value' => $p_interior) );
                    echo  $this->Form->hidden( 'uploads.motor', array( 'value' => $p_motor) );
                    
                    //echo $this->Form->button('Cancelar',array('type'=>'button','onClick'=>'history.back()'));
                     echo $this->Form->submit('Cancelar',array('type'=>'submit','onClick'=>'document.pressed=this.value','value'=>'cancelar'));
                    echo $this->Form->submit('Guardar',array('type'=>'submit','onClick'=>'document.pressed=this.value','value'=>'guardar')); ?>
	   
	    <?php echo $this->Form->end(); ?>
		</div>                  
		</td>
        </tr>
</table>


</dl>
</div>
            
